

using Mengsk.ProxyDelivery.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mengsk.ProxyDelivery.Service
{
    public class SellerPayService : ServiceBase<SellerPay>
    {
        const string APIURL_MARKCOMPLETE = "/webservice/sellerpay/markcomplete.html";

        public DataCollection<SellerPay> GetByAll(long id, int sellerId, PayTypes onlinePayType, SellerPayState state, string comment, string op, DateTime startCreateTime, DateTime endCreateTime, int pageIndex, int pageSize)
        {
            Request req = new Request { Api = "getByAll" };
            req.Add("id", id);
            req.Add("sellerId", sellerId);
            req.Add("onlinePayType", onlinePayType);
            req.Add("state", state);
            req.Add("comment", comment);
            req.Add("operator", op);
            req.Add("startCreateTime", startCreateTime);
            req.Add("endCreateTime", endCreateTime);
            req.Add("pageIndex", pageIndex);
            req.Add("pageSize", pageSize);

            return this.DoRemoteCall<SellerPay>(req).ToDataCollection();
        }

        public void MarkComplete(long id, int sellerId, String comment, String onlinePayaccount)
        {
            IDictionary<string, string> dic = new Dictionary<string, string>();
            dic.Add("id", id.ToString());
            dic.Add("sellerId", sellerId.ToString());
            dic.Add("comment", comment);
            dic.Add("onlinePayaccount", onlinePayaccount);
            this.DoPost<int>(APIURL_MARKCOMPLETE, dic);
        }
    }
}